{% extends '::base_login.html.twig' %}
{% form_theme form 'SieseLoginBundle:Security:captcha.html.twig' %} 

{% block body %}
 
<div class="container" >
    <div class="panel panel-login" >
        <div class="form-central" >
            <img  class="img-login" src="{{ asset('bundles/SieseBundle/images/logo_dp.jpg') }}">
            <div class="nb_sistema">
                Sistema Automatizado de Registro de Inspecciones a Entidades del Sistema Penal de Responsabilidad 
                Adolescente

            </div>

            <div class="col-md-12">
                     {% if error %}
                <div id="login-alert" class="alert alert-danger col-sm-12">
                    <i class="glyphicon glyphicon-warning-sign"></i>
                    &nbsp; 
                            {% if error.message == "Bad credentials" %}
                    Los datos son erróneos
                            {% else %}
                              {{ error.message }}
                            {% endif %}
                </div>

                     {% endif %}                            
            </div>

            <div class="col-md-12">
                <form action="{{ path('login_check') }}" method="post" id="loginform" class="form-horizontal" role="form">

                    
                    <div style="margin-bottom: 25px; margin-left: 15px; margin-right: 15px;" class="input-group">
                        <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
                        <input id="login-username" class="form-control" placeholder="Usuario" type="text" name="_username" value="{{ last_username }}" />
                    </div>

                    <div style="margin-bottom: 25px; margin-left: 15px; margin-right: 15px;" class="input-group">
                        <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
                        <input id="login-password" type="password" class="form-control" name="_password" placeholder="Clave" />
                    </div>
                    
                  
                    <div class="col-md-12 input-group">
                      {{ form_widget(form.captcha) }}
                    </div>
                  
                    <center>
                        <div style="margin-top:10px;" class="form-group">
                            <!-- Button -->
                            <div class="col-sm-10 controls">
                                <button type="submit" id="btn-login" class="btn btn-lg btn-warning" style="text-align:  left;" >Ingresar</button>


                                <a href="{{ path('recuperar-contrasena')}}">Olvido su contraseña o Usuario</a>

                            </div>
                        </div>
                        <div class='icon-manual'>
                            <a target="_blank" href="{{ asset('docs/manualUsuario.pdf') }}""><img class="img-login" title="Descargar Manual de Usuario" src="{{ asset('bundles/SieseBundle/images/images.jpg') }}">
                            </a>
                        </div>
                    </center>
                </form>     

            </div>
        </div>       
    </div>       
{% endblock %}
{% block javascripts %}
    <script>
$(document).ready(function() { 
 // refresh captcha
 $('img#captcha-refresh').click(function() {  
        
        change_captcha();
 });
 
 function change_captcha()
 {
    document.getElementById('captcha').src="get_captcha.php?rnd=" + Math.random();
 }
 });        
    </script>    
{% endblock %}
